In [1]:
1 + 1
Out[1]:
In [2]:
90 * 10
Out[2]:
In [3]:
2 ** 2
Out[3]:
In [4]:
2 ** (2 ** 3)
Out[4]:
In [7]:
1 + (2 * 3)
Out[7]:
In [9]:
(9 * 93) + (2339 - 138)
Out[9]:
In [10]:
8 % 4
Out[10]:
In [11]:
7 % 3
Out[11]:
This 49 happens because of how the modulo operation is defined in mathematics. You can read more about it here: https://en.wikipedia.org/wiki/Modulo_operation AND http://math.stackexchange.com/questions/519845/modulo-of-a-negative-number
For Python specifically you can read about it here: https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations
In [19]:
-1 % 50
Out[19]:
In [24]:
-3 // 4
Out[24]:
In [23]:
12 % 15
Out[23]:
In [ ]:
8